﻿using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Zxgl_ChaKanAll : System.Web.UI.Page
{
    public ArrayList LotteryArrayList =null;//过滤后，投注号码串
    public string zip_scale = "";//压缩比
    public int new_zs = 0, old_zs = 0;//过滤前注数，过滤后注数
    
    protected void Page_Load(object sender, EventArgs e)
    {
        LotteryArrayList = BLL.ArrayListClass.GetArrayList();
        new_zs = ReadRequest.RequestInt("new_zs");
        old_zs = ReadRequest.RequestInt("old_zs");
        zip_scale = ReadRequest.RequestString("zip_scale");
    }
    /// <summary>
    /// 红球和值
    /// </summary>
    /// <param name="Ball">每组投注号的值</param>
    /// <returns></returns>
    public int get_hz(string Ball)
    {
        int strSum = 0;
        string strRedBall = Ball.Substring(0, Ball.LastIndexOf(','));
        string[] strRedBallone = strRedBall.Split(',');
        for (int j = 0; j < strRedBallone.Length; j++)
        {
            strSum += Convert.ToInt32(strRedBallone[j]);
        }
        return strSum;
    }
    /// <summary>
    /// 红球跨度
    /// </summary>
    /// <param name="Ball">每组投注号的值</param>
    /// <returns></returns>
    public int get_kd(string Ball)
    {
        int zdNum = 0;//红球最大值
        int zxNum = 0;//红球最小值
        string strRedBall = Ball.Substring(0, Ball.LastIndexOf(','));
        string[] strRedBallone = strRedBall.Split(',');
        for (int j = 0; j < strRedBallone.Length; j++)
        {
            if (zdNum < Convert.ToInt32(strRedBallone[j]))
            {
                zdNum = Convert.ToInt32(strRedBallone[j]);//跨度（最大号与最小号的差值）--统计最大号码
            }
            if (Convert.ToInt32(strRedBallone[j]) < zxNum)
            {
                zxNum = Convert.ToInt32(strRedBallone[j]);////跨度（最大号与最小号的差值）--统计最小号码
            }
           
        }
        return zdNum - zxNum;
    }
    /// <summary>
    /// 红球奇偶比
    /// </summary>
    /// <param name="Ball">每组投注号的值</param>
    /// <returns></returns>
    public string get_job(string Ball)
{
    int jsNum = 0;//奇数个数
    int osNum = 0;//偶数个数
    string strRedBall = Ball.Substring(0, Ball.LastIndexOf(','));
    string[] strRedBallone = strRedBall.Split(',');
    for (int j = 0; j < strRedBallone.Length; j++)
    {
            if (Convert.ToInt32(strRedBallone[j]) % 2 != 0)//不能被2整除的，则为奇数
            {
                jsNum++;//统计奇数个数累加
            }
    }
        osNum = 6 - jsNum;
    return jsNum+":"+osNum;
    }
    /// <summary>
    /// 红球大小比
    /// </summary>
    /// <param name="Ball">每组投注号的值</param>
    /// <returns></returns>
    public string get_dxb(string Ball)
   {
    int dsNum = 0;//大数个数
    int xsNum = 0;//小数个数
    string strRedBall = Ball.Substring(0, Ball.LastIndexOf(','));
    string[] strRedBallone = strRedBall.Split(',');
    for (int j = 0; j < strRedBallone.Length; j++)
    {
            if (Convert.ToInt32(strRedBallone[j]) >= 17)//小于17为小数。大于等于17为大数
            {
                dsNum++;//统计个数累加
            }
        }
        xsNum = 6 - dsNum;
    return dsNum + ":" + xsNum;
  }
}